package UI;

import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class OtherMessageUI extends JFrame implements MouseListener {
    JButton returnHome = new JButton("返回主页");
    public OtherMessageUI() {
        WholeUI wholeUI = new WholeUI(this) {
            @Override
            protected void elseWindow(JFrame jFrame) {
                jFrame.setTitle("其他消息");
                jFrame.setSize(800,600);
            }
        };
        loadUI();
    }

    private void loadUI() {
        returnHome.setBounds(0,0,100,50);
        this.getContentPane().add(returnHome);
        returnHome.addMouseListener(this);
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (e.getSource() == returnHome) {
            this.dispose();
            new HomeUI();
        }

    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}
